and a bit of NEW_STRINGS cleanup.
if (((c = strchr(cx, '.'))) && (c != cx)) {
*c = '\0';
}
-#if NEW_STRINGS
wpt->shortname = cx;
-#else
- if (wpt->shortname) {
- xfree(wpt->shortname);
- }
- wpt->shortname = xstrdup(cx);
-#endif
xfree(str);
}
case OVL_SYMBOL_TRIANGLE:
wpt = waypt_new();
- wpt->shortname = xstrdup(symbol);
+ wpt->shortname = symbol;
if ((cx = inifile_readstr(inifile, symbol, "YKoord"))) {
wpt->latitude = atof(cx);
if (!wpt) {
return;
}
-#if NEW_STRINGS
wpt->shortname = "Position";
-#else
- if (wpt->shortname) {
- xfree(wpt->shortname);
- }
- wpt->shortname = xstrdup("Position");
-#endif
nmea_add_wpt(wpt, NULL);
return;
}
}
waypt->longitude = ddmm2degrees(lngdeg);
- waypt->shortname = xstrdup(sname);
+ waypt->shortname = sname;
curr_waypt = NULL; /* waypoints won't be updated with GPS fixes */
nmea_add_wpt(waypt, NULL);
wpt = waypt_new();
wpt->latitude = shp->dfYMin;
wpt->longitude = shp->dfXMin;
- wpt->shortname = xstrdup(name);
+ wpt->shortname = name;
if (url) {
wpt->AddUrlLink(url);
}
/* Tweak incoming name if we don't have a fix */
switch (wpt->fix) {
case fix_none:
-#if NEW_STRINGS
wpt->shortname = "ESTIMATED Position";
-#else
- if (wpt->shortname) {
- xfree(wpt->shortname);
- }
- wpt->shortname = xstrdup("ESTIMATED Position");
-#endif
break;
default:
break;